package com.fpd.model.vo;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fpd.tools.DateUtil;
import lombok.Data;

@Data
public class StatisticsCaseVO {
	private String id;
	private String productName;
	private String thirdParty;
	private String custNo;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date beginTimeCase;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date takeBackPlanTime;
	private Integer yuqiDay;// 逾期天数
	private BigDecimal yuqiAmount;// 逾期金额
	private String beginDate;//委案开始时间（年月日）
	private String moneySegment="";//金额段
	
	public String getBeginDate() {
		return null == this.beginTimeCase ? "" : DateUtil.parseDateToStr(this.beginTimeCase, DateUtil.DATE_TIME_FORMAT_YYYYMMDD);
	}
	
	public String getMoneySegment() {
		if (this.yuqiAmount.compareTo(BigDecimal.ZERO) <= 0) {
			return "负数和0";
		} else if (this.yuqiAmount.compareTo(new BigDecimal(1)) >= 0 && this.yuqiAmount.compareTo(new BigDecimal(1000)) <= 0) {
			return "1-1000";
		}  else if (this.yuqiAmount.compareTo(new BigDecimal(1000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(2000)) <= 0) {
			return "1000-2000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(2000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(3000)) <= 0) {
			return "2000-3000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(3000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(4000)) <= 0) {
			return "3000-4000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(4000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(5000)) <= 0) {
			return "4000-5000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(5000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(6000)) <= 0) {
			return "5000-6000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(6000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(7000)) <= 0) {
			return "6000-7000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(7000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(8000)) <= 0) {
			return "7000-8000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(8000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(9000)) <= 0) {
			return "8000-9000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(9000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(10000)) <= 0) {
			return "9000-10000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(10000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(11000)) <= 0) {
			return "10000-11000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(11000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(12000)) <= 0) {
			return "11000-12000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(12000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(13000)) <= 0) {
			return "12000-13000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(13000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(14000)) <= 0) {
			return "13000-14000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(14000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(15000)) <= 0) {
			return "14000-15000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(15000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(16000)) <= 0) {
			return "15000-16000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(16000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(17000)) <= 0) {
			return "16000-17000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(17000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(18000)) <= 0) {
			return "17000-18000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(18000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(19000)) <= 0) {
			return "18000-19000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(19000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(20000)) <= 0) {
			return "19000-20000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(20000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(21000)) <= 0) {
			return "20000-21000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(21000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(22000)) <= 0) {
			return "22000-22000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(22000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(23000)) <= 0) {
			return "22000-23000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(23000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(24000)) <= 0) {
			return "23000-24000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(24000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(25000)) <= 0) {
			return "24000-25000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(25000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(26000)) <= 0) {
			return "25000-26000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(26000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(27000)) <= 0) {
			return "26000-27000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(27000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(28000)) <= 0) {
			return "27000-28000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(28000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(29000)) <= 0) {
			return "28000-29000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(29000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(30000)) <= 0) {
			return "29000-30000";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(30000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(40000)) <= 0) {
			return "3-4万";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(40000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(50000)) <= 0) {
			return "4-5万";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(50000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(60000)) <= 0) {
			return "5-6万";
		}   else if (this.yuqiAmount.compareTo(new BigDecimal(60000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(70000)) <= 0) {
			return "6-7万";
		}    else if (this.yuqiAmount.compareTo(new BigDecimal(70000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(80000)) <= 0) {
			return "7-8万";
		}    else if (this.yuqiAmount.compareTo(new BigDecimal(80000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(90000)) <= 0) {
			return "8-9万";
		}    else if (this.yuqiAmount.compareTo(new BigDecimal(90000)) > 0 && this.yuqiAmount.compareTo(new BigDecimal(100000)) <= 0) {
			return "9-10万";
		}    else {
			return "10万以上";
		} 
	}
}